﻿using MediatR;
using Microsoft.Identity.Client;
using System.Net.NetworkInformation;
using T.Personnel.Domain;
using T.Personnel.Domain.Dto;
using T.Personnel.Read.API.Application.Command.FullManageCommand;
using T.Personnel.Repository.Interface;

namespace T.Personnel.Read.API.Application.CommandHandler.FullManageHandler
{
    public class GetListFullManageHandler : IRequestHandler<GetListFullManageCommand, Result<Manage>>
    {
        private readonly IManageRepository manageRepository;

        public GetListFullManageHandler(IManageRepository manageRepository)
        {
            this.manageRepository = manageRepository;
        }

        public async Task<Result<Manage>> Handle(GetListFullManageCommand request, CancellationToken cancellationToken)
        {
            return await manageRepository.GetFullAsync(request.Name, request.DepartmentId, request.PositionId, request.Hiredate, request.ApplicationDate, request.AppStatus, request.PageIndex, request.PageSize);
        }
    }
}
